package com.lib.base.data

import com.lib.base.data.http.ErrorCodeEnum

class BaseResult<T> : Result<T> {

    /**请求成功与否*/
    var state: Boolean = true
    /**返回信息展示，如请求成功*/
    var msg: String? = null
    /**请求返回码，成功200*/
    var code: Int = 0
    /**错误类型，仅前端使用*/
    var errorCodeEnum: ErrorCodeEnum? = null

    /**请求结果*/
    var results: T? = null

    override fun isError(): Boolean = !state

    override fun getResult(): T? = results

    override fun getResultCode(): Int = code

    override fun getResultMsg(): String? = msg
}